<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./vue1026.js"></script>
</head>
<body>
    <template id="sub">
        {{id}}
    </template>

    <div id="app">
        <sub :id="id"></sub>
    </div>
</body>

<script>
    new Vue({
        el:'#app',
        data:{
            id:100
        },
        components:{
            'sub':{
                template:'#sub',
                props:['id']        //负责接受父组件传入的值
            }
        }
    })

</script>
</html>